<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        var name = $("#name").val();
        $("#contentTable").treeTable();

        function clinicPrint(id){
            //window.location.href ='${ctx}/oper/clinicMaster/clinicPrint?id='+id;
            window.open("${ctx}/finance/outpRcptMaster/hospitalNotice?id="+id)
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/finance/outpRcptMaster/index')">门诊收费记录列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="outpRcptMaster"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/finance/outpRcptMaster/rcptIndex');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    姓名 ：<form:input path="patientId"  id="deptId" style="width: 80px;" class="form-control" />&nbsp;&nbsp;
                                    结账号 ：<form:input path="acctNo"  id="deptId"  class="form-control" />&nbsp;&nbsp;
                                    收款员 ：<form:input path="implementUser"  id="deptId"  class="form-control" />&nbsp;&nbsp;
                                   <%-- 就诊号 ：<form:input path="visitNo"  id="deptId"  class="form-control" />&nbsp;&nbsp;--%>
                                    计费日期 ：<input name="tollStartTime" id="d4311" class="form-control Wdate" type="text" readonly onFocus="WdatePicker({maxDate: '#F{$dp.$D(\'d4312\')||\'2020-10-01\'}' })"/>至
                                    <input name="tollEndTime" id="d4312" class="form-control Wdate" type="text" readonly onFocus="WdatePicker({minDate: '#F{$dp.$D(\'d4311\')}' ,maxDate:'2020-10-01' })"/>
                                    &nbsp;&nbsp;
                                    <input id="search" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
                                </form:form>
                            </div>
                        </div>
                        <table   id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                        <th>收费日期</th>
                                        <th>收费号</th>
                                        <th>结账号</th>
                                        <th>姓名</th>
                                        <th>就诊日期</th>
                                        <th>应收费用</th>
                                        <th>实收费用</th>
                                        <th>收款人</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody >
                            <c:forEach items="${page.list}" var="outpRcptMaster"  varStatus="ss">
                                <tr id="${outpRcptMaster.id}">
                                        <td> <fmt:formatDate value="${outpRcptMaster.createDate}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
                                        <td> ${outpRcptMaster.rcptNo}</td>
                                        <td> ${outpRcptMaster.acctNo}</td>
                                        <td> ${outpRcptMaster.patientId}</td>
                                        <td> ${outpRcptMaster.visitDate}</td>
                                        <td> ${outpRcptMaster.totalCharges}</td>
                                        <td> ${outpRcptMaster.totalCosts}</td>
                                        <td> ${outpRcptMaster.implementUser}</td>
                                    <td>
                                        <a href="#" id="btnPrint" class="btn btn-success btn-xs">打印</a>
                                    </td>
                                </tr>
                                <c:if test="${outpRcptMaster.outpBillItemsList.size()>0}">
                                <tr  id="${ss.count+outpRcptMaster.id}" pid="${outpRcptMaster.id}">
                                    <td colspan="9">
                                        <table id="printbtn" class="table table-bordered mg-t datatable">
                                            <tr>
                                                <th></th>
                                                <th>项目类型</th>
                                                <th>项目名称</th>
                                                <th>项目编码</th>
                                                <th>数量</th>
                                                <th>核算项目科目</th>
                                                <th>会计科目</th>
                                                <th>应付费用</th>
                                                <th>实收费用</th>
                                            </tr>
                                            <c:forEach items="${outpRcptMaster.outpBillItemsList}" var="outpBillItems" varStatus="ss">
                                                <tr>
                                                    <td> ${ss.count}</td>
                                                    <td> ${outpBillItems.itemClass}</td>
                                                    <td> ${outpBillItems.itemName}</td>
                                                    <td> ${outpBillItems.itemCode}</td>
                                                    <td> ${outpBillItems.num}</td>
                                                    <td> ${outpBillItems.classOnReckoning}</td>
                                                    <td> ${outpBillItems.subjCode}</td>
                                                    <td> ${outpBillItems.costs}</td>
                                                    <td> ${outpBillItems.charges}</td>

                                                </tr>
                                            </c:forEach>
                                        </table>
                                    </td>
                                </tr>
                                </c:if>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>